{extend name="public:base"}
{block name='css'}
<link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
<link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
{/block}
{block name="js"}
<script src="__PUBLIC__/js/plugins/layer/laydate5.0.9/laydate.js"></script>
<script>
    $(function(){
        laydate.render({
            elem: '#date'
            ,range: true
        });
        laydate.render({
            elem: '#date1'
            ,range: true
        });
    });
</script>
{/block}
{block name="body"}
<body class="gray-bg">

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>订单管理</h5>
                    <!-- <a href="javascript:;" data-toggle="modal" data-target="#add" onclick="export_order();" class="btn btn-sm btn-primary pull-right m-t-n-xs">导出</a> -->
                </div>
                <div class="ibox-content">
                    <div class="row">
                        <form name="form" action="" id="form" method="get">
                            <div class="col-sm-2 m-b-xs">
                                <select class="form-control m-b" name="status" style="height:30px;padding:4px 12px;">
                                    <option value="">订单状态！</option>
                                    {foreach name="state" item="li" key='key'}
                                    <option value="{$key}" {if condition="input('get.status') eq $key"}selected="selected"{/if}>{$li}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <div class="col-sm-2 m-b-xs">
                                <select class="form-control m-b" name="addr" style="height:30px;padding:4px 12px;">
                                    <option value="">收货地址</option>
                                    <option value="新疆省" {if condition="input('get.addr') eq '新疆省'"}selected="selected"{/if}>新疆省</option>
                                    <option value="内蒙古省" {if condition="input('get.addr') eq '内蒙古省'"}selected="selected"{/if}>内蒙古省</option>
                                   
                                </select>
                            </div>
                            <!-- <div class="col-sm-4 m-b-xs">
                                <div class="input-group" style="padding-left:0px;">
                                    <input type="text" name="keywords" placeholder="下单人姓名/编号"  value="{:input('get.keywords')}" class="input-sm form-control">
                                </div>
                            </div> -->
                            <div class="col-sm-3 m-b-xs">
                                <input type="text" name="range" id="date" value="{:input('get.range')}" placeholder="选择时间段..." class="input-sm form-control">
                            </div>
                            <div class="col-sm-4 m-b-xs">
                                <div class="input-group" style="padding-left:0px;">
                                    <input type="text" name="keywords" placeholder="下单人姓名/编号"  value="{:input('get.keywords')}" class="input-sm form-control">
                                    <span class="input-group-btn">
                                        <input type="submit" class="btn btn-sm btn-primary" value="搜索">
                                        <a href="{:url('index')}" class="btn btn-sm btn-warning"> 重置</a>
                                    </span>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="project-list ">
                        <div class="table-responsive">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <th>订单ID</th>
                                    <th>订单编号</th>
                                    <!-- <th>订单商品</th> -->
                                    <!-- <th>订单数量</th> -->
                                    <th>订单金额</th>
                                    <th>用户编号</th>
                                    <th>用户姓名</th>
                                    <th>下单时间</th>
                                    <!-- {if $Request.param.type == 2}
                                    <th>选择</th>
                                    <th>选择时间</th>
                                    {/if} -->
                                    <th>支付方式</th>
                                    <!-- <th>订单类型</th> -->
                                    <th width="80px">状态</th>
                                    <th width="200">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {volist name="list" id="li" }
                                <tr>
                                    <td>{$li.id}</td>
                                    <td>{$li.sn}</td>
                                    <!-- <td>{$li.name}/{$li.tel}</td> -->
                                    <td>￥{$li.total_amount}</td>
                                    <td>{$li.code}</td>
                                    <td>{$li.nickname}</td>
                                    <td>{$li.create_time}</td>
                                    <td>{$li.pay_way|get_pay_way}</td>
                                      <td><a href="{:url('info' , ['id' => $li['id']])}" class="label label-primary">{$state[$li.state]}</a></td>
                                    <td class="project-actions">
                                        <a href="{:url('info' , ['id' => $li['id']])}" class="btn btn-success btn-xs edit"><i class="fa fa-edit"></i> 详情</a>
                                        {if $li.pay_state ==2}
                                        {if $li.state == 2}
                                        <button class="btn btn-success btn-xs edit"  onclick="show('发货信息填写','{:URL(\'order/add',['id\'=>$li.id,\'type\'=>1])}',450,500)">发货</button>
                                        {else}
                                        <button class="btn btn-success btn-xs edit"  onclick="show('发货信息','{:URL(\'order/add',['id\'=>$li.id,\'type\'=>1])}',450,500)">发货信息</button>
                                        {/if}
                                        {/if}
                                        {eq name='li.state' value='9'}
                                        <a href="javascript:;" onclick="return del();" class="btn btn-danger btn-xs delete"><i class="fa fa-trash-o"></i> 删除</a>
                                        {/eq}
                                    </td>
                                </tr>
                                {/volist}
                                </tbody>
                                <tfoot>
                                <tr>
                                    <td colspan="20" style="text-align:right;border-bottom:0px;">{$list->render()}</td>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="modal inmodal fade" id="add" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header" style="padding:15px;">
                <button type="button" class="close closeReply" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title" style="font-size:20px;">请设置导出条件</h4>
            </div>
            <form class="form-horizontal m-t" target="_blank"  id="signupForm"  method="post" action="{:url('export_order')}">
                <input type="hidden" name="action" value="1" />
                <div class="modal-body">
                    <div class="modal-body" style="padding: 0;">
                       
                        <select class="form-control m-b" name="status" style="height:30px;padding:4px 12px;">
                            <option value="">订单状态！</option>
                            {foreach name="state" item="li" key='key'}
                            <option value="{$key}" {if condition="input('get.status') eq $key"}selected="selected"{/if}>{$li}</option>
                            {/foreach}
                        </select>
                        <input type="text" name="range" id="date1" value="{:input('get.range')}" placeholder="选择时间段..." class="input-sm form-control">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
